package mws;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

import java.util.LinkedList;
import java.util.List;

// 顶层配置类
// 顶层根节点
@Data
public class ThreadPoolConfigRoot {

    @JsonProperty("threadPoolConfig")
    private ThreadPoolConfig threadPoolConfig;
    @Data
    public static class ThreadPoolConfig {
        @JsonProperty("threadPools")
        private List<ThreadPoolProperty> threadPools;
    }

    public static ThreadPoolConfigRoot createThreadPoolConfigRoot(){
        LinkedList<ThreadPoolProperty> objects = new LinkedList<>();
        ThreadPoolConfig threadPoolConfig1 = new ThreadPoolConfig();
        threadPoolConfig1.setThreadPools(objects);
        ThreadPoolConfigRoot threadPoolConfigRoot = new ThreadPoolConfigRoot();
        threadPoolConfigRoot.setThreadPoolConfig(threadPoolConfig1);
        return threadPoolConfigRoot;
    }
}
